/*Joseph A. Coll
RCV and candidate support
10/26/2025*/

*Load data
use "G:\My Drive\Backup 08202022\Working Papers\RCV and Candidate Support\Data and Methods\RCV Candidate Support Data Cleaned.dta", clear
cd "G:\My Drive\Backup 08202022\Working Papers\RCV and Candidate Support\Tables and Figures"
drop if cc_vote == . | cc_ideologue01 == . | cc_ideo_dist01_a == . 

********************************************************************************	
********************************************************************************
********************************************************************************
**#Summary Statistics and Balance
********************************************************************************
********************************************************************************
********************************************************************************	
*Full Sample
estpost sum cc_vote cc_ideologue01 cc_ideo_dist01_a ///
age female educ white liberal conserv dem_wlean rep_wlean 
estimates store sumstat
esttab sumstat using sumstat.tex, ///
cells("mean(fmt(3)) sd(fmt(3)) min(fmt(3)) max(fmt(3)) count(fmt(0))") ///
collabels("Mean" "Std. Dev" "Min." "Max." "N") ///
label replace ///
nonumber noobs
	
*Libs
estpost sum cc_vote cc_ideologue01 cc_ideo_dist01_a ///
age female educ white liberal conserv dem_wlean rep_wlean if liberal ==1
estimates store sumstat_d
esttab sumstat_d using sumstat_d.tex, ///
cells("mean(fmt(3)) sd(fmt(3)) min(fmt(3)) max(fmt(3)) count(fmt(0))") ///
collabels("Mean" "Std. Dev" "Min." "Max." "N") ///
label replace ///
nonumber noobs

*Cons
estpost sum cc_vote cc_ideologue01 cc_ideo_dist01_a ///
age female educ white liberal conserv dem_wlean rep_wlean if conserv ==1
estimates store sumstat_r
esttab sumstat_r using sumstat_r.tex, ///
cells("mean(fmt(3)) sd(fmt(3)) min(fmt(3)) max(fmt(3)) count(fmt(0))") ///
collabels("Mean" "Std. Dev" "Min." "Max." "N") ///
label replace ///
nonumber noobs

iebaltab age female educ white liberal conserv dem_wlean rep_wlean ap_ft_op_pre ap_ft_ip_pre ap_ft_pre op_traits_pre ip_traits_pre ap_traits_pre, group(treatment) savet(bal) replace rowvarlabels nonote starlevels(.05 .01 .001)  addnote(*. .05 **.01 ***.001) control(1) total onerow

********************************************************************************	
********************************************************************************
********************************************************************************
**#Main Analyses and Figures
********************************************************************************
********************************************************************************
********************************************************************************	
*Vote choice
	logit cc_vote i.treatment
	estimates store cc_vote
	margins, dydx(treatment) post
	coefplot, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.3 .3)) ///
	xlabel(-.3(.1).3) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
	name(cc_vote, replace)
	graph export cc_vote.png, replace

*Vote choiceXft_ap
	logit cc_vote i.treatment##c.ap_ft_op_pre 
	estimates store cc_vote_ft_op
	margins, dydx(treatment) at(ap_ft_op_pre=(0(.1)1)) 
	estimates store cc_vote_ft_op
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_op_pre, yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "% of Sample"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_op, replace)
	graph export cc_vote_ft_op.png, replace
	
	logit cc_vote i.treatment##c.ap_ft_ip_pre 
	estimates store cc_vote_ft_ip
	margins, dydx(treatment) at(ap_ft_ip_pre=(0(.1)1)) 
	estimates store cc_vote_ft_ip
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_ip_pre, yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ip, replace)
	graph export cc_vote_ft_ip.png, replace

	logit cc_vote i.treatment##c.ap_ft_pre  
	estimates store cc_vote_ft_ap
	margins, dydx(treatment) at(ap_ft_pre=(-1(.1)1)) 
	estimates store cc_vote_ft_ap
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_pre, yaxis(2) yscale(  alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ap, replace)
	graph export cc_vote_ft_ap.png, replace	
	
*Vote choiceXft_t
	*Out party
	logit cc_vote i.treatment##c.op_traits_pre 
	estimates store cc_vote_t_op
	margins, dydx(treatment) at(op_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_op
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist op_traits_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_op, replace)
	graph export cc_vote_t_op.png, replace
	
	*In party
	logit cc_vote i.treatment##c.ip_traits_pre 
	estimates store cc_vote_t_ip
	margins, dydx(treatment) at(ip_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_ip
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ip_traits_pre, yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ip, replace)
	graph export cc_vote_t_ip.png, replace

	*AP
	logit cc_vote i.treatment##c.ap_traits_pre 
	estimates store cc_vote_t_ap
	margins, dydx(treatment) at(ap_traits_pre=(-.4(.1).6)) 
	estimates store cc_vote_t_ap
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_traits_pre, yaxis(2) yscale(  alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ap, replace)
	graph export cc_vote_t_ap.png, replace	

*Represents ideology
	reg cc_ideologue01 i.treatment
	estimates store cc_ideologue01

	*Ideological distance absolute
	reg cc_ideo_dist01_a i.treatment 
	estimates store cc_ideo_dist01_a

	coefplot cc_ideologue01 cc_ideo_dist01_a, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.22 .22)) ///
	xlabel(-.2(.1).2) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
		legend(order(2 "Canddiate Represents [Lib./Cons.] Ideology" 4 "Ideological Distance") pos(6)) ///
		name(cc_ideo, replace)
	graph export cc_ideo.png, replace
	
*Candidates support
	esttab cc_vote ///
	using cc_main.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and In-Party Candidate Support\label{tab:cc}") ///
	mlabel("") 	
	
*AP FT
	esttab cc_vote_ft_op cc_vote_ft_ip cc_vote_ft_ap  ///
	using ccXapft_main.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment ap_ft_op_pre *.ap_ft_op_pre ap_ft_ip_pre *.ap_ft_ip_pre ap_ft_pre *.ap_ft_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Feeling Thermometer) and In-Party Candidate Support\label{tab:ccXapftmain}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference")
	
*AP T
	esttab cc_vote_t_op cc_vote_t_ip cc_vote_t_ap  ///
	using ccXapt_main.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment op_traits_pre *.op_traits_pre ip_traits_pre *.ip_traits_pre ap_traits_pre *.ap_traits_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Traits) and In-Party Candidate Support\label{tab:ccXaptmain}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference") 	
		
*Candidates perceptions
	esttab cc_ideologue01 cc_ideo_dist01_a  ///
	using cc_ideo_main.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2 N, fmt(2 0) label("R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and Perceptions of In-Party Candidate Ideology\label{tab:ccideomain}") ///
	mlabel("Candidate Reps. Ideology" "Ideological Distance" ) 	

	medeff (regress cc_ideologue01 cc_ideo_dist01_a treatment) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment) if treatment != 2, mediate(cc_ideologue01) treat(treatment)
	*drop _med_delta0 _med_delta1 _med_updelta1 _med_lodelta1 _med_rho _med_updelta0 _med_lodelta0
	medsens (regress cc_ideologue01 cc_ideo_dist01_a treatment) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment) if treatment != 2, mediate(cc_ideologue01) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_ideologue_main, replace)
	graph export medsens_ideologue_main.png, replace

	medeff (regress cc_ideo_dist01_a cc_ideologue01 treatment) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment) if treatment != 2, mediate(cc_ideo_dist01_a) treat(treatment)
	drop _med_delta0 _med_delta1 _med_updelta1 _med_lodelta1 _med_rho _med_updelta0 _med_lodelta0
	medsens (regress cc_ideo_dist01_a cc_ideologue01 treatment) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment) if treatment != 2, mediate(cc_ideo_dist01_a) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_dist_main, replace)
	graph export medsens_dist_main.png, replace

********************************************************************************	
********************************************************************************
********************************************************************************
**# MVC
********************************************************************************
********************************************************************************
********************************************************************************	
fre mvc_correct_total

*Vote choice
	logit cc_vote i.treatment if mvc_correct_total ==3
	estimates store cc_vote_mvc
	margins, at(treatment=(1(1)3)) post
	coefplot cc_vote_mvc, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.3 .3)) ///
	xlabel(-.3(.1).3) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
	name(cc_vote_mvc, replace)
	graph export cc_vote_mvc.png, replace

*Vote choiceXft_ap
	logit cc_vote i.treatment##c.ap_ft_op_pre if mvc_correct_total ==3
	estimates store cc_vote_ft_op_mvc
	margins, dydx(treatment) at(ap_ft_op_pre=(0(.1)1)) 
	estimates store cc_vote_ft_op_mvc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_op_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_op_mvc, replace)
	graph export cc_vote_ft_op_mvc.png, replace
	
	logit cc_vote i.treatment##c.ap_ft_ip_pre if mvc_correct_total ==3
	estimates store cc_vote_ft_ip_mvc
	margins, dydx(treatment) at(ap_ft_ip_pre=(0(.1)1)) 
	estimates store cc_vote_ft_ip_mvc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_ip_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ip_mvc, replace)
	graph export cc_vote_ft_ip_mvc.png, replace

	logit cc_vote i.treatment##c.ap_ft_pre  if mvc_correct_total ==3
	estimates store cc_vote_ft_ap_mvc
	margins, dydx(treatment) at(ap_ft_pre=(-1(.1)1)) 
	estimates store cc_vote_ft_ap_mvc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_pre,   yaxis(2) yscale(  alt axis(2)) percent ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ap_mvc, replace)
	graph export cc_vote_ft_ap_mvc.png, replace	
	
*Vote choiceXft_t
	*Out party
	logit cc_vote i.treatment##c.op_traits_pre if mvc_correct_total ==3
	estimates store cc_vote_t_op_mvc
	margins, dydx(treatment) at(op_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_op_mvc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist op_traits_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_op_mvc, replace)
	graph export cc_vote_t_op_mvc.png, replace
	
	*In party
	logit cc_vote i.treatment##c.ip_traits_pre if mvc_correct_total ==3
	estimates store cc_vote_t_ip_mvc
	margins, dydx(treatment) at(ip_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_ip_mvc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ip_traits_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ip_mvc, replace)
	graph export cc_vote_t_ip_mvc.png, replace

	*AP
	logit cc_vote i.treatment##c.ap_traits_pre if mvc_correct_total ==3
	estimates store cc_vote_t_ap_mvc
	margins, dydx(treatment) at(ap_traits_pre=(-.4(.1).6)) 
	estimates store cc_vote_t_ap_mvc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_traits_pre,   yaxis(2) yscale(  alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ap_mvc, replace)
	graph export cc_vote_t_ap_mvc.png, replace	
	
*Represents ideology
	reg cc_ideologue01 i.treatment if mvc_correct_total ==3
	estimates store cc_ideologue01_mvc

	*Ideological distance absolute
	reg cc_ideo_dist01_a i.treatment if mvc_correct_total ==3
	estimates store cc_ideo_dist01_a_mvc

	coefplot cc_ideologue01_mvc cc_ideo_dist01_a_mvc, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.22 .22)) ///
	xlabel(-.2(.1).2) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
		legend(order(2 "Canddiate Represents [Lib./Cons.] Ideology" 4 "Ideological Distance") pos(6)) ///
		name(cc_ideo_mvc, replace)
	graph export cc_ideo_mvc.png, replace

*Candidates support
	esttab cc_vote_mvc ///
	using cc_mvc.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and In-Party Candidate Support\label{tab:ccmvc}") ///
	mlabel("") 	
	
*AP FT
	esttab cc_vote_ft_op_mvc cc_vote_ft_ip_mvc cc_vote_ft_ap_mvc  ///
	using ccXapft_mvc.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment ap_ft_op_pre *.ap_ft_op_pre ap_ft_ip_pre *.ap_ft_ip_pre ap_ft_pre *.ap_ft_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Feeling Thermometer) and In-Party Candidate Support\label{tab:ccXapftmvc}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference") 	
	
*AP T
	esttab cc_vote_t_op_mvc cc_vote_t_ip_mvc cc_vote_t_ap_mvc  ///
	using ccXapt_mvc.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment op_traits_pre *.op_traits_pre ip_traits_pre *.ip_traits_pre ap_traits_pre *.ap_traits_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Traits) and In-Party Candidate Support\label{tab:ccXaptmvc}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference") 
	
*Candidates perceptions
	esttab cc_ideologue01_mvc cc_ideo_dist01_a_mvc  ///
	using cc_ideo_mvc.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2 N, fmt(2 0) label("R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and Perceptions of In-Party Candidate Ideology\label{tab:ccideomvc}") ///
	mlabel("Candidate Reps. Ideology" "Ideological Distance" ) 	

	medeff (regress cc_ideologue01 cc_ideo_dist01_a treatment) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment) if treatment != 2 & mvc_correct_total ==3, mediate(cc_ideologue01) treat(treatment)
	medsens (regress cc_ideologue01 cc_ideo_dist01_a treatment) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment) if treatment != 2 & mvc_correct_total ==3, mediate(cc_ideologue01) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_ideologue_mvc_mvc, replace)
	
	medeff (regress cc_ideo_dist01_a cc_ideologue01 treatment) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment) if treatment != 2 & mvc_correct_total ==3, mediate(cc_ideo_dist01_a) treat(treatment)
	drop _med_delta0 _med_delta1 _med_updelta1 _med_lodelta1 _med_rho _med_updelta0 _med_lodelta0
	medsens (regress cc_ideo_dist01_a cc_ideologue01 treatment) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment) if treatment != 2 & mvc_correct_total ==3, mediate(cc_ideo_dist01_a) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_dist_main_mvc, replace)

********************************************************************************	
********************************************************************************
********************************************************************************
**# FMC
********************************************************************************
********************************************************************************
********************************************************************************	
fre fmc_correct_total

*Vote choice
	logit cc_vote i.treatment if fmc_correct_total ==3
	estimates store cc_vote_fmc
	margins, at(treatment=(1(1)3)) post
	coefplot cc_vote_fmc, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.3 .3)) ///
	xlabel(-.3(.1).3) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
	name(cc_vote_fmc, replace)
	graph export cc_vote_fmc.png, replace

*Vote choiceXft_ap
	logit cc_vote i.treatment##c.ap_ft_op_pre if fmc_correct_total ==3
	estimates store cc_vote_ft_op_fmc
	margins, dydx(treatment) at(ap_ft_op_pre=(0(.1)1)) 
	estimates store cc_vote_ft_op_fmc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_op_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_op_fmc, replace)
	graph export cc_vote_ft_op_fmc.png, replace
	
	logit cc_vote i.treatment##c.ap_ft_ip_pre if fmc_correct_total ==3
	estimates store cc_vote_ft_ip_fmc
	margins, dydx(treatment) at(ap_ft_ip_pre=(0(.1)1)) 
	estimates store cc_vote_ft_ip_fmc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_ip_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ip_fmc, replace)
	graph export cc_vote_ft_ip_fmc.png, replace

	logit cc_vote i.treatment##c.ap_ft_pre  if fmc_correct_total ==3
	estimates store cc_vote_ft_ap_fmc
	margins, dydx(treatment) at(ap_ft_pre=(-1(.1)1)) 
	estimates store cc_vote_ft_ap_fmc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_pre,   yaxis(2) yscale(  alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ap_fmc, replace)
	graph export cc_vote_ft_ap_fmc.png, replace	
	
*Vote choiceXft_t
	*Out party
	logit cc_vote i.treatment##c.op_traits_pre if fmc_correct_total ==3
	estimates store cc_vote_t_op_fmc
	margins, dydx(treatment) at(op_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_op_fmc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist op_traits_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_op_fmc, replace)
	graph export cc_vote_t_op_fmc.png, replace
	
	*In party
	logit cc_vote i.treatment##c.ip_traits_pre if fmc_correct_total ==3
	estimates store cc_vote_t_ip_fmc
	margins, dydx(treatment) at(ip_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_ip_fmc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ip_traits_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ip_fmc, replace)
	graph export cc_vote_t_ip_fmc.png, replace

	*AP
	logit cc_vote i.treatment##c.ap_traits_pre if fmc_correct_total ==3
	estimates store cc_vote_t_ap_fmc
	margins, dydx(treatment) at(ap_traits_pre=(-.4(.1).6)) 
	estimates store cc_vote_t_ap_fmc
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_traits_pre,   yaxis(2) yscale(  alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ap_fmc, replace)
	graph export cc_vote_t_ap_fmc.png, replace	

*Represents ideology
	reg cc_ideologue01 i.treatment if fmc_correct_total ==3
	estimates store cc_ideologue01_fmc

	*Ideological distance absolute
	reg cc_ideo_dist01_a i.treatment if fmc_correct_total ==3
	estimates store cc_ideo_dist01_a_fmc

	coefplot cc_ideologue01_fmc cc_ideo_dist01_a_fmc, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.22 .22)) ///
	xlabel(-.2(.1).2) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
		legend(order(2 "Canddiate Represents [Lib./Cons.] Ideology" 4 "Ideological Distance") pos(6)) ///
		name(cc_ideo_fmc, replace)
	graph export cc_ideo_fmc.png, replace

*Candidates support
	esttab cc_vote_fmc ///
	using cc_fmc.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and In-Party Candidate Support\label{tab:ccfmc}") ///
	mlabel("") 	
	
*AP FT
	esttab cc_vote_ft_op_fmc cc_vote_ft_ip_fmc cc_vote_ft_ap_fmc  ///
	using ccXapft_fmc.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment ap_ft_op_pre *.ap_ft_op_pre ap_ft_ip_pre *.ap_ft_ip_pre ap_ft_pre *.ap_ft_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Feeling Thermometer) and In-Party Candidate Support\label{tab:ccXapftfmc}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference") 	
	
*AP T
	esttab cc_vote_t_op_fmc cc_vote_t_ip_fmc cc_vote_t_ap_fmc  ///
	using ccXapt_fmc.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment op_traits_pre *.op_traits_pre ip_traits_pre *.ip_traits_pre ap_traits_pre *.ap_traits_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Traits) and In-Party Candidate Support\label{tab:ccXaptfmc}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference") 
	
*Candidates perceptions
	esttab cc_ideologue01_fmc cc_ideo_dist01_a_fmc  ///
	using cc_ideo_fmc.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2 N, fmt(2 0) label("R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and Perceptions of In-Party Candidate Ideology\label{tab:ccideofmc}") ///
	mlabel("Candidate Reps. Ideology" "Ideological Distance" ) 	
	
	medeff (regress cc_ideologue01 cc_ideo_dist01_a treatment) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment) if treatment != 2 & fmc_correct_total ==3, mediate(cc_ideologue01) treat(treatment)
	medsens (regress cc_ideologue01 cc_ideo_dist01_a treatment) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment) if treatment != 2 & fmc_correct_total ==3, mediate(cc_ideologue01) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_ideologue_main_fmc, replace)
	
	medeff (regress cc_ideo_dist01_a cc_ideologue01 treatment) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment) if treatment != 2 & fmc_correct_total ==3, mediate(cc_ideo_dist01_a) treat(treatment)
	drop _med_delta0 _med_delta1 _med_updelta1 _med_lodelta1 _med_rho _med_updelta0 _med_lodelta0
	medsens (regress cc_ideo_dist01_a cc_ideologue01 treatment) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment) if treatment != 2 & fmc_correct_total ==3, mediate(cc_ideo_dist01_a) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_dist_main_fmc, replace)

********************************************************************************	
********************************************************************************
********************************************************************************
**# No Leaners
********************************************************************************
********************************************************************************
********************************************************************************	

*Vote choice
	logit cc_vote i.treatment if moderate !=1 
	estimates store cc_vote_nolean
	margins, at(treatment=(1(1)3)) post
	coefplot cc_vote_nolean, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.3 .3)) ///
	xlabel(-.3(.1).3) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
	name(cc_vote_nolean, replace)
	graph export cc_vote_nolean.png, replace

*Vote choiceXft_ap
	logit cc_vote i.treatment##c.ap_ft_op_pre if moderate !=1 
	estimates store cc_vote_ft_op_nolean
	margins, dydx(treatment) at(ap_ft_op_pre=(0(.1)1)) 
	estimates store cc_vote_ft_op_nolean
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_op_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_op_nolean, replace)
	graph export cc_vote_ft_op_nolean.png, replace
	
	logit cc_vote i.treatment##c.ap_ft_ip_pre if moderate !=1 
	estimates store cc_vote_ft_ip_nolean
	margins, dydx(treatment) at(ap_ft_ip_pre=(0(.1)1)) 
	estimates store cc_vote_ft_ip_nolean
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_ip_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ip_nolean, replace)
	graph export cc_vote_ft_ip_nolean.png, replace

	logit cc_vote i.treatment##c.ap_ft_pre  if moderate !=1 
	estimates store cc_vote_ft_ap_nolean
	margins, dydx(treatment) at(ap_ft_pre=(-1(.1)1)) 
	estimates store cc_vote_ft_ap_nolean
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_pre,   yaxis(2) yscale(  alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ap_nolean, replace)
	graph export cc_vote_ft_ap_nolean.png, replace	
	
*Vote choiceXft_t
	*Out party
	logit cc_vote i.treatment##c.op_traits_pre if moderate !=1 
	estimates store cc_vote_t_op_nolean
	margins, dydx(treatment) at(op_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_op_nolean
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist op_traits_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_op_nolean, replace)
	graph export cc_vote_t_op_nolean.png, replace
	
	*In party
	logit cc_vote i.treatment##c.ip_traits_pre if moderate !=1 
	estimates store cc_vote_t_ip_nolean
	margins, dydx(treatment) at(ip_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_ip_nolean
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ip_traits_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ip_nolean, replace)
	graph export cc_vote_t_ip_nolean.png, replace

	*AP
	logit cc_vote i.treatment##c.ap_traits_pre if moderate !=1 
	estimates store cc_vote_t_ap_nolean
	margins, dydx(treatment) at(ap_traits_pre=(-.4(.1).6)) 
	estimates store cc_vote_t_ap_nolean
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_traits_pre,   yaxis(2) yscale(  alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ap_nolean, replace)
	graph export cc_vote_t_ap_nolean.png, replace	
	
*Represents ideology
	reg cc_ideologue01 i.treatment if moderate !=1 
	estimates store cc_ideologue01_nolean

	*Ideological distance absolute
	reg cc_ideo_dist01_a i.treatment if moderate !=1 
	estimates store cc_ideo_dist01_a_nolean

	coefplot cc_ideologue01_nolean cc_ideo_dist01_a_nolean, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.22 .22)) ///
	xlabel(-.2(.1).2) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
		legend(order(2 "Canddiate Represents [Lib./Cons.] Ideology" 4 "Ideological Distance") pos(6)) ///
		name(cc_ideo_nolean, replace)
	graph export cc_ideo_nolean.png, replace

*Candidates support
	esttab cc_vote_nolean ///
	using cc_nolean.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and In-Party Candidate Support\label{tab:ccnolean}") ///
	mlabel("") 	
	
*AP FT
	esttab cc_vote_ft_op_nolean cc_vote_ft_ip_nolean cc_vote_ft_ap_nolean  ///
	using ccXapft_nolean.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment ap_ft_op_pre *.ap_ft_op_pre ap_ft_ip_pre *.ap_ft_ip_pre ap_ft_pre *.ap_ft_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Feeling Thermometer) and In-Party Candidate Support\label{tab:ccXapftnolean}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference") 	
	
*AP T
	esttab cc_vote_t_op_nolean cc_vote_t_ip_nolean cc_vote_t_ap_nolean  ///
	using ccXapt_nolean.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment op_traits_pre *.op_traits_pre ip_traits_pre *.ip_traits_pre ap_traits_pre *.ap_traits_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Traits) and In-Party Candidate Support\label{tab:ccXaptnolean}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference") 
	
*Candidates perceptions
	esttab cc_ideologue01_nolean cc_ideo_dist01_a_nolean  ///
	using cc_ideo_nolean.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2 N, fmt(2 0) label("R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and Perceptions of In-Party Candidate Ideology\label{tab:ccideonolean}") ///
	mlabel("Candidate Reps. Ideology" "Ideological Distance" ) 	
	
	medeff (regress cc_ideologue01 cc_ideo_dist01_a treatment) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment) if treatment != 2 & moderate !=1 , mediate(cc_ideologue01) treat(treatment)
	medsens (regress cc_ideologue01 cc_ideo_dist01_a treatment) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment) if treatment != 2 & moderate !=1 , mediate(cc_ideologue01) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_ideologue_main_nolean, replace)
	
	medeff (regress cc_ideo_dist01_a cc_ideologue01 treatment) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment) if treatment != 2 & moderate !=1 , mediate(cc_ideo_dist01_a) treat(treatment)
	drop _med_delta0 _med_delta1 _med_updelta1 _med_lodelta1 _med_rho _med_updelta0 _med_lodelta0
	medsens (regress cc_ideo_dist01_a cc_ideologue01 treatment) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment) if treatment != 2 & moderate !=1 , mediate(cc_ideo_dist01_a) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_dist_main_nolean, replace)


********************************************************************************	
********************************************************************************
********************************************************************************
**#Covariates
********************************************************************************
********************************************************************************
********************************************************************************	
	
*Vote choice
	logit cc_vote i.treatment age female educ white liberal conserv dem_wlean rep_wlean
	estimates store cc_vote_cov
	margins, at(treatment=(1(1)3)) post
	coefplot cc_vote_cov, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.3 .3)) ///
	xlabel(-.3(.1).3) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
	name(cc_vote_cov, replace)
	graph export cc_vote_cov.png, replace

*Vote choiceXft_ap
	logit cc_vote i.treatment##c.ap_ft_op_pre age female educ white liberal conserv dem_wlean rep_wlean 
	estimates store cc_vote_ft_op_cov
	margins, dydx(treatment) at(ap_ft_op_pre=(0(.1)1)) 
	estimates store cc_vote_ft_op_cov
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_op_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_op_cov, replace)
	graph export cc_vote_ft_op_cov.png, replace
	
	logit cc_vote i.treatment##c.ap_ft_ip_pre age female educ white liberal conserv dem_wlean rep_wlean 
	estimates store cc_vote_ft_ip_cov
	margins, dydx(treatment) at(ap_ft_ip_pre=(0(.1)1)) 
	estimates store cc_vote_ft_ip_cov
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_ip_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ip_cov, replace)
	graph export cc_vote_ft_ip_cov.png, replace

	logit cc_vote i.treatment##c.ap_ft_pre  age female educ white liberal conserv dem_wlean rep_wlean 
	estimates store cc_vote_ft_ap_cov
	margins, dydx(treatment) at(ap_ft_pre=(-1(.1)1)) 
	estimates store cc_vote_ft_ap_cov
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_ft_pre,   yaxis(2) yscale(  alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_ft_ap_cov, replace)
	graph export cc_vote_ft_ap_cov.png, replace	
	
*Vote choiceXft_t
	*Out party
	logit cc_vote i.treatment##c.op_traits_pre age female educ white liberal conserv dem_wlean rep_wlean 
	estimates store cc_vote_t_op_cov
	margins, dydx(treatment) at(op_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_op_cov
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist op_traits_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_op_cov, replace)
	graph export cc_vote_t_op_cov.png, replace
	
	*In party
	logit cc_vote i.treatment##c.ip_traits_pre age female educ white liberal conserv dem_wlean rep_wlean 
	estimates store cc_vote_t_ip_cov
	margins, dydx(treatment) at(ip_traits_pre=(0(.1)1)) 
	estimates store cc_vote_t_ip_cov
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ip_traits_pre,  yaxis(2) yscale(alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ip_cov, replace)
	graph export cc_vote_t_ip_cov.png, replace

	*AP
	logit cc_vote i.treatment##c.ap_traits_pre age female educ white liberal conserv dem_wlean rep_wlean 
	estimates store cc_vote_t_ap_cov
	margins, dydx(treatment) at(ap_traits_pre=(-.4(.1).6)) 
	estimates store cc_vote_t_ap_cov
	mplotoffset,  ///
	offset(.01) ///
	scheme(plotplain) ///
	yline(0) ///
	title("") ///
	addplot(hist ap_traits_pre,   yaxis(2) yscale(  alt axis(2)) percent ///
	ytitle("Marginal Effect") ///
	xtitle("Affect") ///
	ytitle("% of Sample", axis(2)) ///
	color(gs7%30) ///
	legend(order(3 "RCV Compliment" 4 "RCV Compliment + Endorsement" 5 "{it:N} Distribution"))) ///
	legend(pos(6) row(1)) ///
	name(cc_vote_t_ap_cov, replace)
	graph export cc_vote_t_ap_cov.png, replace	
	
*Represents ideology
	reg cc_ideologue01 i.treatment age female educ white liberal conserv dem_wlean rep_wlean
	estimates store cc_ideologue01_cov

	*Ideological distance absolute
	reg cc_ideo_dist01_a i.treatment age female educ white liberal conserv dem_wlean rep_wlean
	estimates store cc_ideo_dist01_a_cov

	coefplot cc_ideologue01_cov cc_ideo_dist01_a_cov, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.22 .22)) ///
	xlabel(-.2(.1).2) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
		legend(order(2 "Canddiate Represents [Lib./Cons.] Ideology" 4 "Ideological Distance") pos(6)) ///
		name(cc_ideo_cov, replace)
	graph export cc_ideo_cov.png, replace

*Candidates support
	esttab cc_vote_cov ///
	using cc_cov.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and In-Party Candidate Support\label{tab:cccov}") ///
	mlabel("") 	
	
*AP FT
	esttab cc_vote_ft_op_cov cc_vote_ft_ip_cov cc_vote_ft_ap_cov  ///
	using ccXapft_cov.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment ap_ft_op_pre *.ap_ft_op_pre ap_ft_ip_pre *.ap_ft_ip_pre ap_ft_pre *.ap_ft_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Feeling Thermometer) and In-Party Candidate Support\label{tab:ccXapftcov}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference") 	
	
*AP T
	esttab cc_vote_t_op_cov cc_vote_t_ip_cov cc_vote_t_ap_cov  ///
	using ccXapt_cov.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2_p N, fmt(2 0) label("Psuedo R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	order(*.treatment op_traits_pre *.op_traits_pre ip_traits_pre *.ip_traits_pre ap_traits_pre *.ap_traits_pre ) ///
	style(tex) compress ///
	title("Cross-Candidate Communication, Affective Polarization (Traits) and In-Party Candidate Support\label{tab:ccXaptcov}") ///
	mlabel("In-Group Affect" "Out-Group Affect" "Difference") 
	
*Candidates perceptions
	esttab cc_ideologue01_cov cc_ideo_dist01_a_cov  ///
	using cc_ideo_cov.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2 N, fmt(2 0) label("R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and Perceptions of In-Party Candidate Ideology\label{tab:ccideocov}") ///
	mlabel("Candidate Reps. Ideology" "Ideological Distance" ) 	
	
	/*
	medeff (regress cc_ideologue01 cc_ideo_dist01_a treatment age female educ white liberal conserv dem_wlean rep_wlean) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment age female educ white liberal conserv dem_wlean rep_wlean) if treatment != 2, mediate(cc_ideologue01) treat(treatment)
	medsens (regress cc_ideologue01 cc_ideo_dist01_a treatment age female educ white liberal conserv dem_wlean rep_wlean) (logit cc_vote cc_ideologue01 cc_ideo_dist01_a treatment age female educ white liberal conserv dem_wlean rep_wlean) if treatment != 2, mediate(cc_ideologue01) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_ideologue_cov, replace)
	
	medeff (regress cc_ideo_dist01_a cc_ideologue01 treatment age female educ white liberal conserv dem_wlean rep_wlean) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment age female educ white liberal conserv dem_wlean rep_wlean) if treatment != 2, mediate(cc_ideo_dist01_a) treat(treatment)
	drop _med_delta0 _med_delta1 _med_updelta1 _med_lodelta1 _med_rho _med_updelta0 _med_lodelta0
	medsens (regress cc_ideo_dist01_a cc_ideologue01 treatment age female educ white liberal conserv dem_wlean rep_wlean) (logit cc_vote cc_ideo_dist01_a cc_ideologue01 treatment age female educ white liberal conserv dem_wlean rep_wlean) if treatment != 2, mediate(cc_ideo_dist01_a) treat(treatment)
	twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") name(medsens_dist_cov, replace)
	*/
	
********************************************************************************	
********************************************************************************
********************************************************************************
**#Endorsing is Moderate
********************************************************************************
********************************************************************************
********************************************************************************	

*Candidate ideology
	*Full Sample
	reg cc_ideo01 i.treatment 
	estimates store cc_ideo01_full

	reg cc_ideo01 i.treatment if liberal == 1
	estimates store cc_ideo01_lib

	reg cc_ideo01 i.treatment if conserv == 1
	estimates store cc_ideo01_cons

	coefplot cc_ideo01_full cc_ideo01_lib cc_ideo01_cons, ///
	drop(_cons) xline(0) ///
	ylabel(1 "RCV Compliment" 2 "RCV Compliment + Endorsement") ///
	xscale(r(-.22 .22)) ///
	xlabel(-.2(.1).2) ///
	scheme(plotplain) ///
	title("") ///
	mlabel(cond(@pval>.05, string(@b,"%9.3f") + "", ///
	cond(@pval<.001, string(@b,"%9.3f") + "***", ///
	cond(@pval<.01, string(@b,"%9.3f") + "**", ///
	cond(@pval<.05, string(@b,"%9.3f") + "*", ///
	string(@pval,"%9.3f")))))) ///
	mlabpos(10) ///
	mlabgap(2.5) ///
		legend(order(2 "Full Sample" 4 "Liberals" 6 "Conservatives") pos(6)) ///
		name(cc_ideo, replace)
	graph export cc_ideo01_by_ideo.png, replace

*Candidate ideology
	esttab cc_ideo01_full cc_ideo01_lib cc_ideo01_cons  ///
	using cc_ideo01_by_ideo.tex, replace ///
	cells(b(star fmt(3)) p(fmt(3) par) ) starlevels( * 0.05 ** 0.01 *** 0.001) ///
	label ///
	stat(r2 N, fmt(2 0) label("R$^2$" "\textit{N}")) ///
	nodepvars nobase noomitted interaction(" x ") ///
	drop() ///
	style(tex) compress ///
	title("Cross-Candidate Communication and Perceptions of Candidates\label{tab:ccbyideo}") ///
	mlabel("Full Sample" "Liberals" "Conservatives") 	
	
